#include <iostream>
#include <regex>
#include <string>

using namespace std;

int main()
{
    string text = "My email is john@example.com and phone is 123-456-7890";
    smatch matches;
    regex email_pattern(R"(\w+@\w+\.\w+)");
    if (regex_search(text, matches, email_pattern))
    {
        cout << "找到邮箱：" << matches[0] << endl;
    }
    regex number_pattern(R"(\d{3}-\d{3}-\d{4})");
    if (regex_search(text, matches, number_pattern))
    {
        cout << "找到电话号码：" << matches[0] << endl;
    }
    return 0;
}